package test.generics;

public class ClassObjects {

	public static void main(String[] args) throws IllegalAccessException, InstantiationException {

		String string = getInstance(String.class);

		MyClass myClass = getInstance(MyClass.class);
	}

	public static <T> T getInstance(Class<T> theClass) throws IllegalAccessException, InstantiationException {

		return theClass.newInstance();
	}
}
